home *** CD-ROM | disk | FTP | other *** search
- /* XConfig.h
- *
- * Configuration information
- */
-
- /* YAAF - Yet another application framework
- * Copyright (C) 1997 William Edward Woody and In Phase Consulting
- *
- * This library is free software; you can redistribute it
- * and/or modify it under the terms of the GNU Library
- * General Public License as published by the Free Software
- * Foundation; either version 2 of the License, or any
- * later version.
- *
- * This library is distributed in the hope that it will be
- * useful, but WITHOUT ANY WARRANTY; without even the implied
- * warranty of MERCHANTABIILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU Library General Public License for
- * more details.
- *
- * You should have received a copy of the GNU Library General
- * Public License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * To contact the author, either e-mail me at
- * woody@alumni.caltech.edu, or write to us at
- *
- * William Edward Woody
- * In Phase Consulting
- * 1545 Ard Eevin Avenue
- * Glendale, CA 91202
- */
-
- #ifndef __XCONFIG_H__
- #define __XCONFIG_H__
-
- /************************************************************************/
- /* */
- /* OS Selection */
- /* */
- /************************************************************************/
-
- /*
- * This configures one of three fields, depending on the compiler-specific
- * flags that are set. These options are:
- *
- * OPT_MACOS -- 1 if this is the Macintosh version, 0 otherwise
- * OPT_WINOS -- 1 if this is the Win32 version, 0 otherwise
- * OPT_XWIN -- 1 if this is the X Windows version, 0 otherwise
- */
-
- #ifdef __MWERKS__ /* Metrowerks compiler */
-
- #ifdef macintosh
- #define OPT_MACOS 1
- #define OPT_WINOS 0
- #define OPT_XWIN 0
- #endif
-
- #ifdef __INTEL__
- #define OPT_MACOS 0
- #define OPT_WINOS 1
- #define OPT_XWIN 0
- #endif
-
- #endif /* __MWERKS__ */
-
- /************************************************************************/
- /* */
- /* Floating window support (Mac only) */
- /* */
- /************************************************************************/
-
- #if OPT_MACOS == 1
-
- #define OPT_FLOATWINDOW 0 /* 1 == floating window support */
-
- #endif
-
- /************************************************************************/
- /* */
- /* Native Byte Order */
- /* */
- /************************************************************************/
-
- /*
- * OPT_NATIVEORDER
- *
- * This is set to 1 if the native order for word and long word
- * integers are in network native order (680x0 order) or not.
- *
- * My resource files are written in network order, and so I need
- * to know to make sure the data is read correctly
- */
-
- #if OPT_MACOS == 1
- #define OPT_NATIVEORDER 1 /* Native network byte order */
- #elif OPT_WINOS == 1
- #define OPT_NATIVEORDER 0 /* Not native order */
- #endif
-
- /************************************************************************/
- /* */
- /* Boolean Support */
- /* */
- /************************************************************************/
-
- #if OPT_MACOS == 0
-
- #define bool unsigned char /* Quick and dirty bool support */
- #define true 1 /* For bool impared compilers */
- #define false 0
-
- #endif
-
- /************************************************************************/
- /* */
- /* Native structure support */
- /* */
- /************************************************************************/
-
- #if OPT_WINOS == 1
-
- /*
- * Common structure declarations
- */
-
- typedef struct tagRECT Rect;
- typedef struct Point {
- long h;
- long v;
- } Point;
-
- /*
- * Support utilities [mimic stuff I use a lot on Windows]. Note that
- * this is only available in C++; this is to avoid name conflicts
- * with existing WindowsOS calls.
- *
- * (And why bother when Windows already has a version? So I don't have
- * to bracket these in my code with a #if OPT_WINOS == 1/#endif pair
- * every damned time I want to manipulate a rectangle.
- */
-
- #ifdef __cplusplus
-
- extern bool EmptyRect(Rect *);
- extern bool PtInRect(Point,Rect *);
- extern bool SectRect(Rect *, Rect *, Rect *);
-
- #endif /* __cplusplus */
-
- /*
- * Globals
- */
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- extern HINSTANCE _GInstance;
- extern HINSTANCE _GPrevInstance;
- extern LPSTR _GArgString;
- extern int _GArgShow;
-
- #ifdef __cplusplus
- }
- #endif
-
- #endif /* OPT_WINOS */
-
- /************************************************************************/
- /* */
- /* Verify something is set */
- /* */
- /************************************************************************/
-
- #if (OPT_MACOS != 1) && (OPT_WINOS != 1) && (OPT_XWIN != 1)
- #error Must define OPT_MACOS, OPT_WINOS, or OPT_XWIN in XConfig.h
- #endif
-
- #if !defined(OPT_NATIVEORDER)
- #error Must define OPT_NATIVEORDER
- #endif
-
- #endif /* __XCONFIG_H__ */
-